<template>
	<view class="content">
			<view class="postings">
				<view class="post_con" style="border-bottom: 1rpx solid #EEEEEE;">
					<text>企业</text>
					<text>思密达</text>
				</view>
				<view class="post_con">
					<text>位置</text>
					<text>A1-1栋C座电梯井内</text>
				</view>
			</view>
			<view class="postings">
				<view class="post_con">
					<text>巡检日期</text>
					<text>2021/10/11</text>
				</view>
			</view>
			<view class="postings basic">
				<view class="post_con">
					<text>备注</text>
					<text>这是一大段文案，这是一大段文案这是一大段文案这是一大段文案。</text>
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{},
				enterId:'',
				roomVOList:[]
			};
		},
		onLoad(option) {
			this.getTitle(option.name)
			this.getInfo(option.id)
		},
		methods: {
			getInfo(id){
				let that=this
				//联网加载数据
				this.apis.businessApi.qyEnterprise(id).then(res => {
					this.info=res.data
					let roomVOList=[]
					let recordList=res.data.recordList
					for (let i = 0; i < recordList.length; i++) {
						roomVOList=roomVOList.concat(recordList[i].roomVOList)
					}
					this.info.beginTime=recordList[0].beginTime
					this.info.endTime=recordList[0].endTime
					this.roomVOList=roomVOList
				}).catch(()=>{
					//联网失败的回调,隐藏下拉刷新的状态
				})
			},
			getTitle(title) {
				uni.setNavigationBarTitle({
					title: title
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
$subheadColor:#111111;
$titleColor:#333333;
@mixin boldTitle {
	font-size: 28rpx;
	font-weight: 500;
	color: #666666;
}
@mixin  bordcon {
	font-size: 28rpx;
	color: #333333;
}
@mixin  padding {
			padding: 30rpx 0;
}
.content{
	padding: 20rpx;
	box-sizing: border-box;
	.rental_title{
			@include bordcon
			@include padding
			padding: 20rpx 32rpx;
	}
	.postings{
		display: flex;
		flex-direction: column;
		background: #FFFFFF;
		padding: 0 32rpx;
		margin-bottom: 20rpx;
			border-radius: 12rpx;
		box-sizing: border-box;
		.post_con{
			display: flex;
			justify-content: space-between;
			@include padding
			text:nth-child(1){
				@include boldTitle
			}
			text:nth-child(2){
				@include bordcon
			}
			// 待租
			.rent{
				color: #F74D39 !important;
			}
			// 已租
			.occupancy{
				color: #44D94B !important;
			}
		}
	}
	.basic{
		.post_con{
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			border-bottom: 1rpx solid #EEEEEE;
			@include padding
			text:nth-child(1){
				@include boldTitle;
				margin-bottom: 20rpx;
				
			}
			text:nth-child(2){
				@include bordcon
			}
		}
		view:last-child{
			border-bottom: none;
		}
	}
}
</style>
